#include"SList.h"

void test1()
{
    //开上4个节点
    SLNode* node1=(SLNode*)malloc(sizeof(SLNode));
    node1->data=1;
    SLNode* node2=(SLNode*)malloc(sizeof(SLNode));
    node2->data=2;
    SLNode* node3=(SLNode*)malloc(sizeof(SLNode));
    node3->data=3;
    SLNode* node4=(SLNode*)malloc(sizeof(SLNode));
    node4->data=4;
    //连接起来
    node1->next=node2;
    node2->next=node3;
    node3->next=node4;
    node4->next=NULL;
    //打印一下
    SLNode* plist =node1;
    SLPrint(plist);

}
void test2()
{
    SLNode* plist=NULL;
    SLNode* plist2=NULL;
    SLPushBack(&plist,2);
    SLPushBack(&plist,1);
    // SLPushBack(&plist,3);
    // SLPushBack(&plist,2);
    // SLPushBack(&plist,5);
    // SLPushBack(&plist,2);
    //SLPushBack(&plist,3);
    
    // SLPushFront(&plist,3);
    // SLPushFront(&plist,4);
    SLPrint(plist);
    SLPrint(partition(plist,2));
    //SLPrint(plist2);
    
    //SLPrint(removeElements(plist,1));
    //SLPrint(removeElements2(&plist,1));
    //removeElements2(NULL,3);
    //SLPrint(reverseList(plist));//原链表会被改掉
    //SLPrint(mergeTwoLists2(plist,plist2));
    //printf ("%d\n",ysf(43,9001));
    //printf("%d\n",SLFind(&plist,2)->data);
    //SLPopBack(&plist);
    //SLPopFront(&plist);
    //SLNode*find=SLFind(&plist,4);
    //SLInsert(&plist,find,8);
    //SLInsertAfter(find,9);
    //SLPrint(plist);
    // SLErase(&plist,find);
    //SLEraseAfter(find);
    SLDesTroy(&plist);
}

int main ()
{
    //test1();
    test2();
    return 0;
}